﻿<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="title" value="收支明细表" />
<c:if test="${rcType=='P'}"><c:set var="title" value="支出明细表" /></c:if>
<c:if test="${rcType=='R'}"><c:set var="title" value="收入明细表" /></c:if>
<c:set var="pageTitle" value="${title}" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		window.close();
	}
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			document.getElementById("noPrinSpan").style.display="none";
			printContent("管理易-${title}","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			document.getElementById("noPrinSpan").style.display="";
		}
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td height="40px" align="center" class="FontLarge_Bold">${baName} ${title}</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="left" width="50%">日期：${startDate} 至 ${endDate}</td>
				 	<td class="FontSmall" align="right">
				 	 	<c:if test="${rcType=='R'}">收入小计：${rcostTotal} 元</c:if>
						<c:if test="${rcType=='P'}">支出小计：${pcostTotal} 元</c:if>
						<c:if test="${rcType!='P' && rcType!='R'}">收入小计：${rcostTotal} 元&nbsp;&nbsp;支出小计：${pcostTotal} 元</c:if>
				 	</td>
			  </tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<c:if test="${listType!='LOG'}">
					<td class="ListTd FontSmall_Bold" width="12%"  align="center">日期</td>
					<td class="ListTd FontSmall_Bold" width="16%" align="center">单号</td>
					<td class="ListTd FontSmall_Bold" width="8%" align="center">类型</td>
					<td class="ListTd FontSmall_Bold" width="16%" align="center">摘要</td>
					<td class="ListTd FontSmall_Bold" width="10%" align="center">经办人</td>
					<td class="ListTd FontSmall_Bold" width="12%" align="center">收入</td>
					<td class="ListTd FontSmall_Bold" width="12%" align="center">支出</td>
					<td class="ListTd FontSmall_Bold" width="14%" align="center">账户</td>
					</c:if>
					<c:if test="${listType=='LOG'}">
					<td class="ListTd FontSmall_Bold" width="11%"  align="center">记账日期</td>
					<td class="ListTd FontSmall_Bold" width="15%" align="center">单号</td>
					<td class="ListTd FontSmall_Bold" width="8%" align="center">类型</td>
					<td class="ListTd FontSmall_Bold" width="14%" align="center">摘要</td>
					<td class="ListTd FontSmall_Bold" width="8%" align="center">经办人</td>
					<td class="ListTd FontSmall_Bold" width="10%" align="center">收入</td>
					<td class="ListTd FontSmall_Bold" width="10%" align="center">支出</td>
					<td class="ListTd FontSmall_Bold" width="12%" align="center">账户余额</td>
					<td class="ListTd FontSmall_Bold" width="12%" align="center">账户</td>
					</c:if>
				</tr>
				<c:forEach var="item" items="${list}" varStatus="i">
				<c:set var="styleStr" value="" />
 				<c:if test="${item.operType=='UN_EXAM' || item.operType=='CANC'}"><c:set var="styleStr" value="style='color:red'" /></c:if>
				<tr class="ListTrPrint" ${styleStr}>
					<td class="FontSmall" align="center">
						<c:if test="${listType=='LOG'}"><fmt:formatDate value="${item.costDate}" pattern="yyyy-MM-dd HH:mm" /></c:if>
						<c:if test="${listType!='LOG'}"><fmt:formatDate value="${item.billDate}" pattern="yyyy-MM-dd" /></c:if>
					</td>
					<td class="FontSmall" align="center">${item.billCode}</td>
					<td class="FontSmall" align="center">${item.costType}</td>
					<td class="FontSmall" align="center">${item.mark}</td>
					<td class="FontSmall" align="center">${item.managerName}</td>
					<td class="FontSmall" align="right">
						<c:if test="${item.rcType=='R'}">${item.cost}</c:if>
						<c:if test="${item.rcType=='P'}">0&nbsp;</c:if>
					</td>
					<td class="FontSmall" align="right">
						<c:if test="${item.rcType=='R'}">0&nbsp;</c:if>
						<c:if test="${item.rcType=='P'}">${item.cost}</c:if>
					</td>
					<c:if test="${listType=='LOG'}">
					<td class="FontSmall" align="right">${item.baCost}</td>
					</c:if>
					<td class="FontSmall" align="center"><commonTag:showSimpleObjectName list="${baList}" objectId="${item.bankAccountId}" /></td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	<tr>
		<td height="10"></td>
	</tr>
	<tr id="noPrinSpan">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value="开始打印" onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>